#encoding:utf-8
'''
Created on 2012/2/2
此為從attribute + class的檔案中取出sample的程式
並且將取出的class輸出到參數三
@author: Netdb_Heng
'''
#參數一為母體，參數二為輸入Label，參數三為輸出sample，參數四為輸出sample的class，參數五為筆數

import sys,random

print ( sys.argv[1] + " to " + sys.argv[2] + ":" + sys.argv[3] + "~" + sys.argv[4])

inf = open(sys.argv[1])

outf = open(sys.argv[2],'w')



choose_record = []      #挑選過的

lines = inf.readlines()

outf.write(lines[0])

for i in range(int(sys.argv[3]),int(sys.argv[4])+1):
    outf.write(lines[i])

       
inf.close();
outf.close();

